//
//  ViewController.m
//  UI_11_XibCustomCell
//
//  Created by li cheng on 16/7/28.
//  Copyright © 2016年 li cheng. All rights reserved.
//

#import "ViewController.h"
#import "NewsTableViewCell.h"
@interface ViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *newsTableView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    // 自定义tableViewCell
    // 1.在创建cell的时候, 勾选, Also create xib file
    // 2.在xib文件中进行cell的布局
    // 3.通过自定义cell的xib文件注册cell
    [self.newsTableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"pool"];
    [self.newsTableView registerNib:[UINib nibWithNibName:@"NewsTableViewCell" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"NewsTableViewCell"];
    }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NewsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"NewsTableViewCell" forIndexPath:indexPath];
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
